package IC.AST.nodes;

import java.util.List;
import IC.AST.*;
import IC.Analyzer.SymTable;
import IC.lir.ClassInfo;

/**
 * a class declaration
 */
public class ClassDecl extends ASTNode {
	private String classID;	// the class name
	private String baseClassID;	// the base class
	private List<ASTNode> classMembers;	// list of class members
	private SymTable staticSymTab; //  static symbol table
	private ClassInfo classInfo; // class information record

	public ClassInfo getClassInfo() {
		return classInfo;
	}
	
	public void setClassInfo(ClassInfo classInfo) {
		this.classInfo = classInfo;
	}
	
	/**
	 * @param classID the class name
	 * @param baseClassID the base class
	 * @param classMembers list of class members
	 * @param fileName TODO
	 * @param line the node line number
	 * @param column the node column number
	 */
	public ClassDecl(String classID, String baseClassID, List<ASTNode> classMembers, String fileName, int line, int column) {
		super(fileName,line, column);
		this.classID = classID;
		this.baseClassID = baseClassID;
		this.classMembers = classMembers;
	}

	/**
	 * @return the class name
	 */
	public String getClassID() {
		return this.classID;
	}

	/**
	 * @return the base class
	 */
	public String getBaseClassID() {
		return this.baseClassID;
	}

	/**
	 * @return list of class members
	 */
	public List<ASTNode> getClassMembers() {
		return this.classMembers;
	}

	public <D,U> U accept(PropogatingVisitor<D,U> v, D context) throws Exception {
		return v.visit(this,context);
	}

	/**
	 * @return the staticSymTab
	 */
	public SymTable getStaticSymTab() {
		return staticSymTab;
	}

	/**
	 * @param staticSymTab the staticSymTab to set
	 */
	public void setStaticSymTab(SymTable staticSymTab) {
		this.staticSymTab = staticSymTab;
	}
}
